<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>企业认证-已审核</title>
</head>
<body>
<div id="custom-toolbar">
    <div class="form-inline" role="form">
        <div class="form-group">
            <span class="input-icon inverted">
                <input type="text" class="form-control" placeholder="搜素范围：用户名、帐号" id="customQuery" style="width: 250px">
                <i class="glyphicon glyphicon-search bg-blue"></i>
            </span>
        </div>
        <div class="form-group">
            <a href="javascript:void(0);" class="btn btn-labeled btn-blue" id="refresh">
                <i class="btn-label glyphicon glyphicon-refresh"></i>刷新
            </a>
        </div>
    </div>
</div>
<br>
<table id="pendingAuditCompanyList"></table>

<script type="text/javascript">
    $initTable($("#pendingAuditCompanyList"), pendingAuditCompanyColumns(), ipAddress + '/auth/loadAuthCompany', true, null, {authStatus: 0});

    //搜索
    $searchEvent($("#pendingAuditCompanyList"), $("#customQuery"));

    // 刷新
    $refreshEvent($("#pendingAuditCompanyList"), $("#customQuery"));

    // 审核信息
    function checkAuth(me) {
        var id = $(me).attr("oid");
        showDialog("/Admin/template/userAuth/checkAuthCompany.html", "审核认证信息", 650, 700, function () {
            $("#id").val(id);
            getAuth(id);
        });
    }

    // 获取个人和企业认证信息
    function getAuth(id) {
//        // 获取个人认证信息
//        $get(ipAddress + '/auth/loadUserPersonAuth/' + id, {}, function (json) {
//            var info = json.data;
//            if (info != null) {
//                var html = " <span class='label " + labelTypeArr[info.status] + " graded'> " + authArr[info.status] + " </span> ";
//                $(html).appendTo("#content_person");
//                $("#person_name").val(info.name);
//                $("#person_card").val(info.card);
//                $("#person_cardForgeImage").attr("src", imgIp + info.cardForgeImage);
//                $("#person_cardBackImage").attr("src", imgIp + info.cardBackImage);
//                info.status == 0 ? $("#person_action").css("display", "block") : "";
//            }
//        });

        // 获取企业认证信息
        $get(ipAddress + '/auth/loadUserCompanyAuth/' + id, {}, function (json) {
            var info = json.data;
            if (info != null) {
                var html = " <span class='label " + labelTypeArr[2] + " graded'> 未认证 </span> ";
                $(html).appendTo("#content_company");
                $("#company_name").val(info.companyName);
                $("#company_licenseNo").val(info.licenseNo);
                $("#company_licenseImage").attr("src", imgIp + info.licenseImage);
                $("#company_introduceImage").attr("src", imgIp + info.introduceImage);
                $("#company_action").css("display", "block");
            } else {
                $("#company_status").val('未认证').css('color', 'red');
            }
        });
    }
</script>
</body>
</html>